#ifndef _SOCKET_HPP_
# define _SOCKET_HPP_

# include <string>
# include <iostream>
# include <cerrno>
# include <cstring>
# include <cstdio>

# include <sys/types.h>
# include <sys/socket.h>
# include <netdb.h>
# include <arpa/inet.h>

class Socket
{
public:
  Socket();
  ~Socket();

private:
  Socket(const Socket &);
  const Socket &operator=(const Socket &);

public:
  bool connect(const std::string &hostname, const char *port);
  bool send(const std::string &msg);
  bool send(const char *msg, int size);
  void close();

private:
  int socket_;
};

#endif //!_SOCKET_HPP_
